home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-08-11 | 12.8 KB | 379 lines | [TEXT/Anon] |
-
- MAC.68K
-
-
-
-
-
-
- INTRODUCTION
- INTRODUCTION
- INTRODUCTION
-
-
-
-
-
- MAC.68K is a fast, full featured assembler that can produce
-
-
- clickable applications for the Macintosh. It is compatible with
-
-
- the CPM-68K assembler AS68.
-
-
-
- MAC.68K can easily be used for small assembly programs, but
-
-
- it also has the features and speed neccessary to build and
-
-
- maintain very large programs. It contains a full set of pseudo
-
-
- operations, list options, macro definition capabiltites, and the
-
-
- complete 68000 instruction set. Key features include:
-
-
-
-
- Macro definition/expansion
-
-
- Hierarchical expression evalution
-
-
- Column error flags
-
-
- Included text files
-
-
- Fast loading macro/symbol and code libraries
-
-
- Nested conditionals
-
-
- Sorted symbol table with cross references
-
-
- String and substring manipulation
-
-
-
-
- This manual describes the use and rules of MAC.68K. It does
-
-
- not attempt to teach the M68000 assembly language, how to write
-
-
- and debug an application, or the use and concepts of the
-
-
- Macintosh toolbox.
-
-
-
-
- This manual was originally written for the CPM-68K version of
-
-
- MAC.68K. It contains some references to CPM-68K concepts that
-
-
- have not been fully implemented yet on the Macintosh version. One
-
-
- particular area of an unimplemented concept is the drive number
-
-
- specification. In CPM-68K individual floppies are not named (no
-
-
- volume names). Individual disk drives are specified by placing a
-
-
- one character drive name (e.g. A:) as a prefix to a file name.
-
-
- CYCLAN eventually plans some technique of specifying volume names
-
-
- as a prefix so we are leaving in the documentation references to
-
-
- drive names even though they currently have no effect on a
-
-
- Macintosh assembly.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -1- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- I. Invoking the Assembler
- I. Invoking the Assembler
- I. Invoking the Assembler
-
-
-
-
-
- MAC.68K is called with the following command line. Square
-
-
- brakets [] enclose the optional parameters. Parameters may be
-
-
- entered in any order. Single letter dash options may be grouped
-
-
- together.
-
-
-
-
- MAC [-F d:] [-P] [-O object filename] [-L] [-U] [-K] [-C]
-
-
- source filename [>listing filename]
-
-
-
-
- Option Purpose
- ______ _______
-
-
-
- -F d: Specifies the drive on which to place
-
-
- temporary files. If not given, the current
-
-
- drive is used.
-
-
-
-
- -P Enables generation of the program listing.
-
-
- The default list device is the console. The
-
-
- listing can be redirected to another device
-
-
- or file by using the >filename parameter.
-
-
- Error messages are always sent to the
-
-
- console and to the selected output device
-
-
- or file.
-
-
-
-
- -O object filename Directs the object file from its default
-
-
- destination/name (see pseudo op IDENT) to
-
-
- the specified file name.
-
-
-
-
- source filename The only required parameter for MAC.68K.
-
-
- This file contains the source lines to be
-
-
- assembled.
-
-
-
-
- >listing filename If selected, the program listing is directed
-
-
- to the specified file instead of the console.
-
-
- -P is automatically enabled when a >filename
-
-
- is used.
-
-
-
-
- -L Force long word absolute memory references.
-
-
-
-
- -U Treat all undefined symbols as global
-
-
- references. (Future use)
-
-
-
-
-
-
-
-
-
-
- MAC.68K -2-
-
-
-
- MAC.68K
-
-
-
-
-
- While printing, MAC.68K monitors the keyboard prior to each
-
-
- page break. An S or ctl/C key will stop the assembly and control
-
-
- will return to CPM-68K. If MAC.68K is pausing on screen full,
-
-
- any key other than S or ctl/C will resume the assembly.
-
-
-
-
-
-
-
-
- II. MAC.68K LANGUAGE
- II. MAC.68K LANGUAGE
- II. MAC.68K LANGUAGE
-
-
-
-
-
- II.1 Instruction Fields
- II.1 Instruction Fields
- II.1 Instruction Fields
-
-
-
-
- Each MAC.68K instruction consists of 4 optional fields
-
-
- separated by one or more blanks. Each instruction line is
-
-
- terminated by a carriage return character. Any line feed
-
-
- characters following a carriage return are ignored.
-
-
-
-
- Location Operation Code Operand(s) Comment
-
-
-
-
- The location field must begin in column 1. If column 1 is
-
-
- blank then there is no location field. Depending on the operation
-
-
- field, the location field contains either a symbol or a name. A
-
-
- location symbol may optionally end with a : .
-
-
-
- The operation field begins with the first non-blank character
-
-
- after the location field. It may begin no sooner than column 2,
-
-
- but must appear by column 32. The operation field contains either
-
-
- an M68000 op code, a pseudo op code, or a macro name.
-
-
-
- The operand field begins with the first non-blank character
-
-
- following the operation field. It may consist of one or more
-
-
- subfields separated by commas, and it too must begin by column
-
-
- 32. Depending on the operation field, these subfields contain an
-
-
- M68000 effective address, an expression, a name, or a macro
-
-
- argument. Note that a blank embedded in a character data item or
-
-
- enclosed in a parenthesized macro parameter does not terminate an
-
-
- operand subfield.
-
-
-
- The comment field begins with the first non-blank character
-
-
- following the operand field.
-
-
-
-
- II.2 Continuation Lines
- II.2 Continuation Lines
- II.2 Continuation Lines
-
-
-
-
- Each instruction line may contain up to 256 data characters.
-
-
- An instruction line (of any length) may be continued by placing a
-
-
- , (comma) in column 1 of the next instruction line. A maximum of
-
-
- two continuation lines are allowed. The total character count in
-
-
-
-
-
- -3- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- a continued instruction may not exceed 256 characters.
-
-
-
-
- II.3 Comment Lines
- II.3 Comment Lines
- II.3 Comment Lines
-
-
-
-
- A comment line contains an asterisk or a semicolon in column
-
-
- 1 or blanks in columns 1 thru 32.
-
-
-
-
- II.4 Imbedded Tab Characters
- II.4 Imbedded Tab Characters
- II.4 Imbedded Tab Characters
-
-
-
-
- MAC.68K honors 2 types of imbedded tab conventions. The ASCII
-
-
- tab character HT ($09) is expanded by inserting blanks until
-
-
- column 1 9 17 25 33 41 49 57 65 73 or 81 is reached. The Pascal
-
-
- blank compression sequence of character DLE ($10) followed by
-
-
- character $20+n (where n is the number of blanks) will be
-
-
- expanded by inserting n blanks.
-
-
-
-
- II.5 Symbols
- II.5 Symbols
- II.5 Symbols
-
-
-
-
- A symbol is a string of 1 to 8 characters that identifies a
-
-
- value and its associated attributes. A symbol character may be
-
-
- A-Z, a-z, 0-9, or one of the following:
-
-
- . $ _ = ~ period dollar underscore equal tilda
-
-
- A symbol may not begin with a number or a $.
-
-
-
- Valid Symbol Examples Invalid Symbol Examples
-
-
-
- B A123 3TAG (starts with a number)
-
-
- broom A456.789 *tag (contains an invalid character)
-
-
- _Sam TAG p12345678 (too long)
-
-
- SAM_T tag$ $TAG (starts with a $)
-
-
-
- A symbol used in the location field of a M68000 instruction
-
-
- is defined to have the current value of the location counter.
-
-
-
- A symbol used in the location field of a pseudo instruction
-
-
- is defined to have a value based on an expression from an operand
-
-
- field of the instruction. Certain pseudo operation codes create a
-
-
- redefinable symbol whose value may be changed by another pseudo
-
-
- operation. Unless a symbol is redefinable, any attempt to define
-
-
- it with another value will generate a *D* type (Duplicate symbol
-
-
- definition) error.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -4-
-
-
-
- MAC.68K
-
-
-
-
-
- II.6 Reserved Symbols
- II.6 Reserved Symbols
- II.6 Reserved Symbols
-
-
-
-
- Register names are reserved symbol names for MAC.68K. These
-
-
- are A0-A7, D0-D7, a0-a7, d0-d7, A0.L-A7.L, D0.L-D7.L, a0.l-a7.l,
-
-
- d0.l-d7.l, CCR, ccr, SR, sr, SP, sp, SSP, ssp, USP, usp, P and p.
-
-
- Note that all register names you may use any combination of upper
-
-
- case and lower case alphas. (E.g., CCR and cCr are equivalent).
-
-
- The following special symbols are used to reference assembler
-
-
- values:
-
-
-
- * or *L Current value of the location counter.
-
-
- *O Current value of the origin counter.
-
-
- *P Current bit position within the current byte.
-
-
-
-
- Symbol names ..0000 thru ..FFFF are reserved for use as local
-
-
- symbol names within macro expressions.
-
-
-
-
-
- II.7 Upper and Lower Case Characters Within Symbols
- II.7 Upper and Lower Case Characters Within Symbols
- II.7 Upper and Lower Case Characters Within Symbols
-
-
-
-
- By default lower case alphas are treated as unique
-
-
- characters. In this mode, BROOM and Broom are two distinct
-
-
- symbol names.
-
-
-
- By selecting option UPPER (see pseudo op OPTION), all lower
-
-
- case alpha characters (a-z) are internally converted to upper
-
-
- case prior to being processed. In this mode, BROOM Broom BRooM
-
-
- all refer to the same symbol.
-
-
-
- Regardless of the case option selected, the output listing
-
-
- always contains the original upper and lower case characters.
-
-
-
-
- II.8 Names
- II.8 Names
- II.8 Names
-
-
-
-
- A name is a string of 1 to 8 characters that is used to
-
-
- identify:
-
-
-
- Program IF sequence
-
-
- Macro String
-
-
- DEFER sequence M68000 instruction
-
-
- DUP sequence pseudo Instruction
-
-
-
-
- Valid characters for a name are A-Z, 0-9, and _ . $ =. A
-
-
- name may not begin with a number. Program names are further
-
-
- restricted by operating system file name conventions. For CPM-68K
-
-
- this means = is not a valid character.
-
-
-
-
-
-
-
-
- -5- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- While lower case alphas may be used in the source file, they
-
-
- will be internally converted to upper case (A-Z) before being
-
-
- used in a name. For example, a moveq in the operation field is
-
-
- always treated as MOVEQ regardless of the case option selected.
-
-
-
-
- II.9 Concatenation or Ghost Characters
- II.9 Concatenation or Ghost Characters
- II.9 Concatenation or Ghost Characters
-
-
-
-
- The & (ampersand) character is used to join two adjacent
-
-
- strings in a source line. MAC.68K removes all & characters after
-
-
- macro parameter substitution but before actual instruction
-
-
- processing. The ampersand is often called a ghost character
-
-
- because it does not appear in the final listing.
-
-
-
- Concatenation may be used in any source line. It is not
-
-
- restricted to use within macro definitions.
-
-
-
- Example of Concatenation Used Within a Macro Call
-
-
-
- A Macro Definition Macro Call
-
-
-
- TEST MACRO XX,ADDR TEST EQ,TAG2
-
-
- B&XX ADDR
-
-
- ENDM Macro Expansion
-
-
-
- BEQ TAG2
-
-
-
-
- II.10 Strings and String Substitution
- II.10 Strings and String Substitution
- II.10 Strings and String Substitution
-
-
-
-
- MAC.68K uses pairs of " characters to signal string
-
-
- substitution within a source line. Each " character pair brackets
-
-
- a previously defined string name. The entire reference ("s and
-
-
- name) is removed and the actual string value is substituted.
-
-
- After substitution the remaining characters in the source line
-
-
- will be shifted left or right the appropriate number of
-
-
- positions.
-
-
- A null string name is valid.
-
-
-
- Example of String Substitution
-
-
-
- Definition
-
-
-
- DATE STRING 1,,* 1/12/84*
-
-
-
- Use
-
-
-
- DC.L 8H"DATE" becomes ---> DC.L 8H 1/12/84
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -6-
-
-
- DC.L 8H"DA